﻿using System.Web.UI;
using System.Xml.Linq;

namespace SPAdaptiveMenu.Controls
{
    ///<summary>
    ///</summary>
    public class MenuSeparator : MenuItem
    {
        public override MenuItemType ItemType
        {
            get { return MenuItemType.Separator; }
        }

        protected override void Render(HtmlTextWriter writer)
        {

            writer.Write("<ie:menuitem type=\"separator\"></ie:menuitem>");
        }

        protected internal override XElement Serialized
        {
            get
            {
                var element = base.Serialized;
                element.Add(new XAttribute("Type", ItemType));
                return element;
            }
        }

        protected internal override XElement HTML
        {
            get
            {
                var element = new XElement("menuitem", new XAttribute("type", "separator"));
                return element;
            }
        }
    }
}
